<?php
/*
Template Name: Processor
This will process all the request
Author: Najeeb
*/
$wpdb->hide_errors(); nocache_headers();


//echo ESTATE_PLUGIN."nm_estate.php";
$e = new nmRealEstate();

switch($_POST['act'])
{
	case 'list-new-property':
	
	$e -> detail			= $_POST['detail'];
	$e -> price				= $_POST['price'];			
	$e -> postcode			= $_POST['postcode'];
	$e -> rooms				= $_POST['rooms'];
	$e -> area				= $_POST['area'];
	$e -> sleeps			= $_POST['sleeps'];
	$e -> closest_tube		= $_POST['closest_tube'];
	$e -> type				= $_POST['type'];			
	$e -> pets				= $_POST['pets'];
	$e -> smoking			= $_POST['smoking'];
	$e -> deposit_info		= $_POST['deposit_info'];
	$e -> internet			= $_POST['internet'];
	$e -> wifi				= $_POST['wifi'];
	$e -> kitchen			= $_POST['kitchen'];
	$e -> garden			= $_POST['garden'];
	$e -> disabled_access	= $_POST['disabled_access'];
	$e -> cable				= $_POST['cable'];
	$e -> tv				= $_POST['tv'];
	$e -> BBQ				= $_POST['BBQ'];
	//user personal info
	$e -> firstname			= $_POST['firstname'];
	$e -> surname			= $_POST['surname'];
	$e -> telephone			= $_POST['telephone'];
	$e -> email1			= $_POST['email1'];			
	$e -> email2			= $_POST['email2'];
	$e -> images			= $_POST['images_list'];		//it will be serialized data
	$e -> status 			= 'Pending';
	
	//var_dump($e);
	if($e -> saveListing())
		echo 'success';
	else
		echo 'error';
	break;
}

	
?>
